/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('qianzhou', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AICreateSessionMessageRequest {
  context?: {
    clusterId?: string(name='cluster_id'),
    error?: string(name='error'),
    kind?: string(name='kind'),
    name?: string(name='name'),
    namespace?: string(name='namespace'),
    uuid?: string(name='uuid'),
  }(name='context'),
  language?: string(name='language'),
  message?: string(name='message'),
  sessionId?: string(name='session_id'),
  type?: string(name='type', example='QA / K8S_DIAGNOSE'),
  employeeId?: string(name='employee_id', description='This parameter is required.'),
}

model AICreateSessionMessageResponseBody = {
  answer?: string(name='answer'),
  code?: long(name='code'),
  data?: string(name='data'),
  msg?: string(name='msg'),
  reference?: [ 
    {
      title?: string(name='Title'),
      url?: string(name='Url'),
    }
  ](name='reference'),
  requestId?: string(name='requestId'),
  sessionId?: string(name='session_id'),
}

model AICreateSessionMessageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AICreateSessionMessageResponseBody(name='body'),
}

/**
 * @summary ACK AI助手千舟InnerAPI
 *
 * @param request AICreateSessionMessageRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return AICreateSessionMessageResponse
 */
async function aICreateSessionMessageWithOptions(request: AICreateSessionMessageRequest, headers: map[string]string, runtime: Util.RuntimeOptions): AICreateSessionMessageResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.employeeId)) {
    query['employee_id'] = request.employeeId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.context)) {
    body['context'] = request.context;
  }
  if (!Util.isUnset(request.language)) {
    body['language'] = request.language;
  }
  if (!Util.isUnset(request.message)) {
    body['message'] = request.message;
  }
  if (!Util.isUnset(request.sessionId)) {
    body['session_id'] = request.sessionId;
  }
  if (!Util.isUnset(request.type)) {
    body['type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AICreateSessionMessage',
    version = '2021-11-11',
    protocol = 'HTTPS',
    pathname = `/popapi/AICreateSessionMessage`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary ACK AI助手千舟InnerAPI
 *
 * @param request AICreateSessionMessageRequest
 * @return AICreateSessionMessageResponse
 */
async function aICreateSessionMessage(request: AICreateSessionMessageRequest): AICreateSessionMessageResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return aICreateSessionMessageWithOptions(request, headers, runtime);
}

model CreateDiagnosisRequest {
  body?: string(name='body'),
  clusterID?: string(name='clusterID'),
  diagnosisType?: string(name='diagnosisType'),
}

model CreateDiagnosisResponseBody = {
  code?: long(name='code'),
  data?: any(name='data'),
  requestId?: string(name='requestId'),
}

model CreateDiagnosisResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDiagnosisResponseBody(name='body'),
}

/**
 * @summary CreateDiagnosis
 *
 * @param request CreateDiagnosisRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDiagnosisResponse
 */
async function createDiagnosisWithOptions(request: CreateDiagnosisRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateDiagnosisResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.clusterID)) {
    query['clusterID'] = request.clusterID;
  }
  if (!Util.isUnset(request.diagnosisType)) {
    query['diagnosisType'] = request.diagnosisType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = request.body,
  };
  var params = new OpenApi.Params{
    action = 'CreateDiagnosis',
    version = '2021-11-11',
    protocol = 'HTTPS',
    pathname = `/popapi/createDiagnosis`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary CreateDiagnosis
 *
 * @param request CreateDiagnosisRequest
 * @return CreateDiagnosisResponse
 */
async function createDiagnosis(request: CreateDiagnosisRequest): CreateDiagnosisResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createDiagnosisWithOptions(request, headers, runtime);
}

model GetClusterRequest {
  clusterID?: string(name='clusterID'),
}

model GetClusterResponseBody = {
  data?: {
    clusterID?: string(name='clusterID'),
    clusterType?: string(name='clusterType'),
    currentVersion?: string(name='currentVersion'),
    name?: string(name='name'),
    profile?: string(name='profile'),
    regionID?: string(name='regionID'),
    securityGroupId?: string(name='securityGroupId'),
    spec?: string(name='spec'),
    state?: string(name='state'),
    userID?: string(name='userID'),
  }(name='data'),
  requestId?: string(name='requestId'),
}

model GetClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetClusterResponseBody(name='body'),
}

/**
 * @summary 获取集群信息
 *
 * @param request GetClusterRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetClusterResponse
 */
async function getClusterWithOptions(request: GetClusterRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetClusterResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.clusterID)) {
    query['clusterID'] = request.clusterID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCluster',
    version = '2021-11-11',
    protocol = 'HTTPS',
    pathname = `/popapi/getCluster`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取集群信息
 *
 * @param request GetClusterRequest
 * @return GetClusterResponse
 */
async function getCluster(request: GetClusterRequest): GetClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getClusterWithOptions(request, headers, runtime);
}

model GetClusterWarningRequest {
  clusterID?: string(name='clusterID'),
}

model GetClusterWarningResponseBody = {
  requestId?: string(name='requestId'),
}

model GetClusterWarningResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetClusterWarningResponseBody(name='body'),
}

/**
 * @summary 单个集群的高危风险项
 *
 * @param request GetClusterWarningRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetClusterWarningResponse
 */
async function getClusterWarningWithOptions(request: GetClusterWarningRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetClusterWarningResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.clusterID)) {
    query['clusterID'] = request.clusterID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetClusterWarning',
    version = '2021-11-11',
    protocol = 'HTTPS',
    pathname = `/popapi/getKeyClusterWarningList`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 单个集群的高危风险项
 *
 * @param request GetClusterWarningRequest
 * @return GetClusterWarningResponse
 */
async function getClusterWarning(request: GetClusterWarningRequest): GetClusterWarningResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getClusterWarningWithOptions(request, headers, runtime);
}

model GetDiagnosisResultRequest {
  diagnosisId?: string(name='diagnosisId'),
  ownerUid?: string(name='ownerUid'),
}

model GetDiagnosisResultResponseBody = {
  code?: string(name='code'),
  data?: any(name='data'),
  msg?: string(name='msg'),
  requestId?: string(name='requestId'),
}

model GetDiagnosisResultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDiagnosisResultResponseBody(name='body'),
}

/**
 * @summary GetDiagnosisResult
 *
 * @param request GetDiagnosisResultRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDiagnosisResultResponse
 */
async function getDiagnosisResultWithOptions(request: GetDiagnosisResultRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetDiagnosisResultResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.diagnosisId)) {
    query['diagnosisId'] = request.diagnosisId;
  }
  if (!Util.isUnset(request.ownerUid)) {
    query['ownerUid'] = request.ownerUid;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDiagnosisResult',
    version = '2021-11-11',
    protocol = 'HTTPS',
    pathname = `/popapi/GetDiagnosisResult`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary GetDiagnosisResult
 *
 * @param request GetDiagnosisResultRequest
 * @return GetDiagnosisResultResponse
 */
async function getDiagnosisResult(request: GetDiagnosisResultRequest): GetDiagnosisResultResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getDiagnosisResultWithOptions(request, headers, runtime);
}

model GetUserClusterWarningRequest {
  userID?: string(name='userID'),
}

model GetUserClusterWarningResponseBody = {
  requestId?: string(name='requestId'),
}

model GetUserClusterWarningResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetUserClusterWarningResponseBody(name='body'),
}

/**
 * @summary 单个用户的高危集群
 *
 * @param request GetUserClusterWarningRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetUserClusterWarningResponse
 */
async function getUserClusterWarningWithOptions(request: GetUserClusterWarningRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetUserClusterWarningResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.userID)) {
    query['userID'] = request.userID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetUserClusterWarning',
    version = '2021-11-11',
    protocol = 'HTTPS',
    pathname = `/popapi/listUserKeyClusters`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 单个用户的高危集群
 *
 * @param request GetUserClusterWarningRequest
 * @return GetUserClusterWarningResponse
 */
async function getUserClusterWarning(request: GetUserClusterWarningRequest): GetUserClusterWarningResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getUserClusterWarningWithOptions(request, headers, runtime);
}

model GetWebshellTokenResponseBody = {
  requestId?: string(name='requestId'),
}

model GetWebshellTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetWebshellTokenResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI GetWebshellToken is deprecated
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetWebshellTokenResponse
 */
// Deprecated
async function getWebshellTokenWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): GetWebshellTokenResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetWebshellToken',
    version = '2021-11-11',
    protocol = 'HTTPS',
    pathname = `/popapi/getChorusToken`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @deprecated OpenAPI GetWebshellToken is deprecated
 *
 * @return GetWebshellTokenResponse
 */
// Deprecated
async function getWebshellToken(): GetWebshellTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getWebshellTokenWithOptions(headers, runtime);
}

model HelloRequest {
  user?: string(name='user', example='binzhi'),
}

model HelloResponseBody = {
  code?: string(name='code', example='200'),
  data?: {
    date?: string(name='date'),
    name?: string(name='name', example='ack1'),
    success?: boolean(name='success', example='false'),
  }(name='data'),
  msg?: string(name='msg', example='null'),
  requestId?: string(name='requestId'),
}

model HelloResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: HelloResponseBody(name='body'),
}

/**
 * @summary 测试接口
 *
 * @param request HelloRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return HelloResponse
 */
async function helloWithOptions(request: HelloRequest, headers: map[string]string, runtime: Util.RuntimeOptions): HelloResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.user)) {
    query['user'] = request.user;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'Hello',
    version = '2021-11-11',
    protocol = 'HTTPS',
    pathname = `/popapi/hello`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 测试接口
 *
 * @param request HelloRequest
 * @return HelloResponse
 */
async function hello(request: HelloRequest): HelloResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return helloWithOptions(request, headers, runtime);
}

model ListClusterDeprecatedAPIRequest {
  clusterId?: string(name='cluster_id'),
  pageNo?: int32(name='page_no'),
  pageSize?: int32(name='page_size'),
  targetVersion?: string(name='target_version'),
}

model ListClusterDeprecatedAPIResponseBody = {
  code?: int32(name='code'),
  datas?: {
    current?: int32(name='current'),
    data?: [ 
      {
        clusterId?: string(name='cluster_id'),
        content?: string(name='content'),
        count?: int32(name='count'),
        currentVersion?: string(name='current_version'),
        deprecatedK8sVersion?: string(name='deprecated_k8s_version'),
        ds?: string(name='ds'),
        label?: string(name='label'),
        lastTime?: string(name='last_time'),
        requestUri?: string(name='request_uri'),
        sourceIps?: string(name='source_ips'),
        targetVersion?: string(name='target_version'),
        userAgent?: string(name='user_agent'),
      }
    ](name='data'),
    pageSize?: int32(name='pageSize'),
    total?: int32(name='total'),
  }(name='datas'),
  msg?: string(name='msg'),
  requestId?: string(name='requestId'),
}

model ListClusterDeprecatedAPIResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListClusterDeprecatedAPIResponseBody(name='body'),
}

/**
 * @summary 获取某集群废弃api的统计情况
 *
 * @param request ListClusterDeprecatedAPIRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListClusterDeprecatedAPIResponse
 */
async function listClusterDeprecatedAPIWithOptions(request: ListClusterDeprecatedAPIRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListClusterDeprecatedAPIResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.clusterId)) {
    query['cluster_id'] = request.clusterId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['page_no'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['page_size'] = request.pageSize;
  }
  if (!Util.isUnset(request.targetVersion)) {
    query['target_version'] = request.targetVersion;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListClusterDeprecatedAPI',
    version = '2021-11-11',
    protocol = 'HTTPS',
    pathname = `/popapi/listDeprecatedK8sAPI`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取某集群废弃api的统计情况
 *
 * @param request ListClusterDeprecatedAPIRequest
 * @return ListClusterDeprecatedAPIResponse
 */
async function listClusterDeprecatedAPI(request: ListClusterDeprecatedAPIRequest): ListClusterDeprecatedAPIResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listClusterDeprecatedAPIWithOptions(request, headers, runtime);
}

model ListClusterImagesRequest {
  clusterId?: string(name='cluster_id'),
  imageHash?: string(name='image_hash'),
  imageName?: string(name='image_name'),
  pageNo?: int32(name='page_no'),
  pageSize?: int32(name='page_size'),
  uid?: string(name='uid'),
}

model ListClusterImagesResponseBody = {
  code?: int32(name='code'),
  datas?: {
    current?: int32(name='current'),
    data?: [ 
      {
        clusterId?: string(name='cluster_id'),
        controllerName?: string(name='controller_name'),
        controllerType?: string(name='controller_type'),
        created?: string(name='created'),
        imageHash?: string(name='image_hash'),
        imageName?: string(name='image_name'),
        namespace?: string(name='namespace'),
        uid?: string(name='uid'),
        updated?: string(name='updated'),
      }
    ](name='data'),
    pageSize?: int32(name='pageSize'),
    total?: int32(name='total'),
  }(name='datas'),
  msg?: string(name='msg'),
  requestId?: string(name='requestId'),
}

model ListClusterImagesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListClusterImagesResponseBody(name='body'),
}

/**
 * @summary 获取某集群中的Image列表
 *
 * @param request ListClusterImagesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListClusterImagesResponse
 */
async function listClusterImagesWithOptions(request: ListClusterImagesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListClusterImagesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.clusterId)) {
    query['cluster_id'] = request.clusterId;
  }
  if (!Util.isUnset(request.imageHash)) {
    query['image_hash'] = request.imageHash;
  }
  if (!Util.isUnset(request.imageName)) {
    query['image_name'] = request.imageName;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['page_no'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['page_size'] = request.pageSize;
  }
  if (!Util.isUnset(request.uid)) {
    query['uid'] = request.uid;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListClusterImages',
    version = '2021-11-11',
    protocol = 'HTTPS',
    pathname = `/popapi/listClusterPodImages`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取某集群中的Image列表
 *
 * @param request ListClusterImagesRequest
 * @return ListClusterImagesResponse
 */
async function listClusterImages(request: ListClusterImagesRequest): ListClusterImagesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listClusterImagesWithOptions(request, headers, runtime);
}

model ListUserClustersRequest {
  current?: string(name='current'),
  pageSize?: string(name='pageSize'),
  userID?: string(name='userID'),
}

model ListUserClustersResponseBody = {
  code?: long(name='code'),
  data?: string(name='data'),
  msg?: string(name='msg'),
  requestId?: string(name='requestId'),
}

model ListUserClustersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUserClustersResponseBody(name='body'),
}

/**
 * @summary 获取用户下的集群列表
 *
 * @param request ListUserClustersRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListUserClustersResponse
 */
async function listUserClustersWithOptions(request: ListUserClustersRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListUserClustersResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.current)) {
    query['current'] = request.current;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.userID)) {
    query['userID'] = request.userID;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListUserClusters',
    version = '2021-11-11',
    protocol = 'HTTPS',
    pathname = `/popapi/listUserClusters`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取用户下的集群列表
 *
 * @param request ListUserClustersRequest
 * @return ListUserClustersResponse
 */
async function listUserClusters(request: ListUserClustersRequest): ListUserClustersResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listUserClustersWithOptions(request, headers, runtime);
}

model QueryByInstanceInfoRequest {
  instanceId?: [ string ](name='InstanceId'),
  regionId?: string(name='RegionId'),
}

model QueryByInstanceInfoResponseBody = {
  code?: int32(name='code'),
  data?: [ 
    {
      clusterId?: string(name='clusterId'),
      clusterName?: string(name='clusterName'),
      instanceId?: string(name='instanceId'),
      regionId?: string(name='regionId'),
      uid?: string(name='uid'),
    }
  ](name='data'),
  msg?: string(name='msg'),
  requestId?: string(name='requestId'),
}

model QueryByInstanceInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryByInstanceInfoResponseBody(name='body'),
}

/**
 * @summary 查询节点相关集群、用户信息
 *
 * @param request QueryByInstanceInfoRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryByInstanceInfoResponse
 */
async function queryByInstanceInfoWithOptions(request: QueryByInstanceInfoRequest, headers: map[string]string, runtime: Util.RuntimeOptions): QueryByInstanceInfoResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryByInstanceInfo',
    version = '2021-11-11',
    protocol = 'HTTPS',
    pathname = `/popapi/queryByInstanceInfo`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询节点相关集群、用户信息
 *
 * @param request QueryByInstanceInfoRequest
 * @return QueryByInstanceInfoResponse
 */
async function queryByInstanceInfo(request: QueryByInstanceInfoRequest): QueryByInstanceInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return queryByInstanceInfoWithOptions(request, headers, runtime);
}

model QueryNodeInfoRequest {
  instanceId?: string(name='instanceId', description='This parameter is required.'),
  regionId?: string(name='regionId'),
}

model QueryNodeInfoResponseBody = {
  code?: int32(name='code'),
  data?: [ 
    {
      cluserName?: string(name='cluserName'),
      clusterId?: string(name='clusterId'),
      instanceId?: string(name='instanceId'),
      region?: string(name='region'),
      uid?: string(name='uid'),
    }
  ](name='data'),
  msg?: string(name='msg'),
  requestId?: string(name='requestId'),
}

model QueryNodeInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryNodeInfoResponseBody(name='body'),
}

/**
 * @summary 根据节点instanceId查询集群/用户信息
 *
 * @param request QueryNodeInfoRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryNodeInfoResponse
 */
async function queryNodeInfoWithOptions(request: QueryNodeInfoRequest, headers: map[string]string, runtime: Util.RuntimeOptions): QueryNodeInfoResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['instanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['regionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryNodeInfo',
    version = '2021-11-11',
    protocol = 'HTTPS',
    pathname = `/popapi/queryByInstanceId`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 根据节点instanceId查询集群/用户信息
 *
 * @param request QueryNodeInfoRequest
 * @return QueryNodeInfoResponse
 */
async function queryNodeInfo(request: QueryNodeInfoRequest): QueryNodeInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return queryNodeInfoWithOptions(request, headers, runtime);
}

